package pl.plesken.tools;

import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;

public class SortXMLFiles {
	static LinkedList<String> LoadData = new LinkedList<String>();
	static List<SortListXMLFiles> row = new ArrayList<SortListXMLFiles>();
	
	public static LinkedList<String> getLoadData() {
		return LoadData;
	}

	public static void setLoadData(LinkedList<String> loadData) {
		LoadData = loadData;
	}

	public static List<SortListXMLFiles> getRow() {
		return row;
	}

	public static void setRow(List<SortListXMLFiles> row) {
		SortXMLFiles.row = row;
	}

	public static List<SortListXMLFiles> getSortListXMLFiles() {
		
		row.clear();
		
		for (int i = 0; i < LoadData.size(); i++) {
			row.add(new SortListXMLFiles(i + 1, LoadData.get(i).toString()));
			//System.out.println(LoadData.get(i).toString());
		}
		
		return row;
	}
	
	public static void sortRun() {
		List list = SortXMLFiles.getSortListXMLFiles();
		Collections.sort(list, new SortListByName());
		//printList(list);
	}
	
    private static void printList(List<SortListXMLFiles> list) {
        System.out.println("#Tytuł");
        for (SortListXMLFiles e: list) {
            System.out.println(e.getName());
        }
    }
}
